import { createGetRequest, createPostRequest } from '@/utils/request'

// 获取档案列表
const getMZList = async (params) => {
    return await createGetRequest('/mz/list', params)
}

// 新建档案
const addRecord = async (values) => {
    return await createPostRequest('/mz/addRecord', values)
}

// 保存病历
const saveBL = async (values) => {
    return await createPostRequest('/mz/saveBL', values)
}

// 编辑病历
const editBL = async (values) => {
    return await createPostRequest('/mz/editBL', values)
}

// 删除单个病历
const deleteBL = async (id) => {
    return await createGetRequest('/mz/deleteBL', { blId: id })
}

const uploadResult = async (formData) => {
    return await createPostRequest('/mz/uploadFiles ', formData)
}

// 删除病历档案
const deleteRecord = async (recordId) => {
    return await createGetRequest('/mz/deleteRecord', { recordId })
}

// 删除检验结果照片
const deleteJYJG = async (id) => {
    return await createGetRequest('/mz/deleteJYJG', { id })
}
// 获取档案详情，包括病例和检验结果
const getRecordDetail = async (data) => {
    return await createGetRequest('/mz/recordDetail', data)
}
// 根据id获取病历详情，包括内容、患者指纹、医生签名 
const getBLDetail = async (data) => {
    return await createGetRequest('/mz/blDetail', data)
}


export {
    getMZList,
    addRecord,
    saveBL,
    uploadResult,
    deleteRecord,
    getRecordDetail,
    getBLDetail,
    editBL,
    deleteBL,
    deleteJYJG
}
